package com.huiren.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.huiren.bean.Order;
import com.huiren.mapper.OrderMapper;
import com.huiren.meta.SearchMeta;
import com.huiren.service.OrderService;
import com.huiren.util.JdbcUtil;

@Service
public class OrderServiceImpl implements OrderService {

	@Autowired
	private OrderMapper orderMapper;

	public List<Order> selectOrder(SearchMeta searchMeta) throws Exception {
		List<Map<String, Object>> list = JdbcUtil
				.executeQuery("select * from T_YJ_CONFIG where key='group'");
		String groupby = list.get(0).get("value").toString();
		searchMeta.setGroupby(groupby);
		return orderMapper.selectOrder(searchMeta);
	}

	public int importOrder(Map map) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}
}
